const Router = require('@koa/router');
const roleController = require('../controller/role.controller');
const auth = require('../middleware/auth');

const router = new Router({
  prefix: '/api/roles'
});

// 获取角色列表
router.get('/', auth, roleController.getRoles);

// 创建角色
router.post('/', auth, roleController.createRole);

// 更新角色
router.put('/:id', auth, roleController.updateRole);

// 删除角色
router.delete('/:id', auth, roleController.deleteRole);

module.exports = router; 